local bailoujian_skill = fk.CreateSkill {
  name = "#bailoujian_skill",
  attached_equip = "bailoujian",
}



bailoujian_skill:addEffect(fk.TargetSpecified, {
  name = "#bailoujian_skill",
  events = { fk.TargetSpecified },
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(bailoujian_skill.name) and data.card.trueName == "slash" and
        data.card.suit == Card.Club
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = data.to
    local choose
    if to:isKongcheng() then
      choose = "#bailoujian-choose2"
    else
      choose = room:askForChoice(to, { "#bailoujian-choose1", "#bailoujian-choose2:" .. player.id }, bailoujian_skill.name)
    end
    if choose == "#bailoujian-choose1" then
      local targetcard = room:askForCardChosen(to, to, "h", bailoujian_skill.name, "#bailoujian-choose_card")
      room:throwCard(targetcard, bailoujian_skill.name, to, player)
    else
      player:drawCards(1, bailoujian_skill.name)
    end
  end
})

return bailoujian_skill